package com.es.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 描述:
 * es-servlet-
 *
 * @author Derek
 * 创建时间：2022-04-19 11:47
 */
@WebServlet(urlPatterns = {"/life.wzz"},loadOnStartup = 1)
public class ServletLife extends HttpServlet {
    //1实例化
    public ServletLife(){
        System.out.println("我是实例化方法");
    }

    @Override
    public void destroy() {
        System.out.println("我是servlet的销毁方法");
    }

    @Override
    public void init() throws ServletException {
        System.out.println("我是用来进行初始化的方法");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("对外提供服务的方法。。。");
    }


}
